package com.android.vgongyi.parser;

import java.io.InputStream;
import java.util.ArrayList;

import android.content.Context;

import com.android.vgongyi.entity.CommonBean;
import com.android.vgongyi.entity.CommonEntity;
import com.android.vgongyi.service.VGongyiException;
import com.android.vgongyi.utils.StringUtil;
import com.google.gson.Gson;

public class AdvParser extends BaseParser{

	public ArrayList<CommonEntity> executeToObject(InputStream in, Context context) throws VGongyiException {
		if(in == null){
			return null;
		} 
		ArrayList<CommonEntity> channelList = new ArrayList<CommonEntity>();	
		String json = StringUtil.converStreamToString(in);
	    Gson gson = new Gson();	        
	    channelList = gson.fromJson(json, CommonBean.class).getList();
		return channelList;
	}
}
